package com.yx.system.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.yx.common.base.BaseController;
import com.yx.common.utils.Query;
import com.yx.common.utils.R;
import com.yx.system.entity.SysLog;
import com.yx.system.service.SysLogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/** 系统日志
 * Created by wuye on 2017/11/24.
 */
@RestController
@RequestMapping("/sys/log")
public class SysLogController extends BaseController {
    @Autowired
    private SysLogService sysLogService;

    /**
     * 列表
     */
    @ResponseBody
    @RequestMapping("/list")
    @RequiresPermissions("sys:log:list")
    public R list(@RequestParam Map<String, Object> params){
        //查询列表数据
        Query query = new Query(params);
        Page<SysLog> pageUtil = new Page<SysLog>(query.getPage(), query.getLimit());

        Page<SysLog> page = sysLogService.selectPageList(pageUtil,query);

        return R.ok().put("page", page);
    }

}

